home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / ptv1n4.arc / GETCOLOR.ASM < prev    next >
Assembly Source File  |  1990-09-13  |  1KB  |  32 lines

  1. ;********** GETCOLOR.ASM - retrieves the current colors in use by QuickBASIC
  2.  
  3. ;Copyright (c) 1990 Ethan Winer
  4.  
  5. ;Usage: CALL GetColor(FG%, BG%, Border%)
  6.  
  7. ;NOTE: This routine cannot be used within a Quick Library.
  8.  
  9. .Model Medium, Basic
  10. .Data
  11.     Extrn B$FBColors:Word, B$BorderColor:Byte
  12.  
  13. .Code
  14.  
  15. GetColor Proc, FG:Word, BG:Word, Border:Word
  16.  
  17.     Mov  DX,B$FBColors      ;get the combined foreground/background word
  18.     Mov  AL,DL              ;copy the foreground portion to AL
  19.     Cbw                     ;convert the byte to a full integer word
  20.     Mov  BX,FG              ;get the address for FG%
  21.     Mov  [BX],AX            ;and assign FG%
  22.     Mov  AL,DH              ;now load AL with the background portion
  23.     Mov  BX,BG              ;point BX to the BG% parameter
  24.     Mov  [BX],AX            ;and assign BG% (AH is still zero)
  25.     Mov  AL,B$BorderColor   ;get BASIC's border color
  26.     Mov  BX,Border          ;point BX to Border%
  27.     Mov  [BX],AX            ;assign Border%
  28.     Ret                     ;return to BASIC
  29.  
  30. GetColor Endp
  31. End
  32.